﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FlashToolKit
{
	/// <summary>
	/// Provides conversion facilities.
	/// </summary>
	public static class Convert
	{
		/// <summary>
		/// Converts SWF tag type to string
		/// </summary>
		/// <param name="type">
		/// Tag type
		/// </param>
		/// <returns>
		/// Type string
		/// </returns>
		public static string TagTypeToStr(short type)
		{
			var tag = (Tag) type;
			switch (tag)
			{
				case Tag.ShowFrame:
					return "ShowFrame";
				case Tag.DefineShape:
					return "DefineShape";
				case Tag.PlaceObject:
					return "PlaceObject";
				case Tag.RemoveObject:
					return "RemoveObject";
				case Tag.DefineBits:
					return "DefineBits";
				case Tag.DefineButton:
					return "DefineButton";
				case Tag.JPEGTables:
					return "JPEGTables";
				case Tag.SetBackgroundColor:
					return "SetBackgroundColor";
				case Tag.DefineFont:
					return "DefineFont";
				case Tag.DefineText:
					return "DefineText";
				case Tag.DoAction:
					return "DoAction";
				case Tag.DefineFontInfo:
					return "DefineFontInfo";
				case Tag.DefineSound:
					return "DefineSound";
				case Tag.StartSound:
					return "StartSound";
				case Tag.DefineButtonSound:
					return "DefineButtonSound";
				case Tag.SoundStreamHead:
					return "SoundStreamHead";
				case Tag.SoundStreamBlock:
					return "SoundStreamBlock";
				case Tag.DefineBitsLossless:
					return "DefineBitsLossless";
				case Tag.DefineBitsJPEG2:
					return "DefineBitsJPEG2";
				case Tag.DefineShape2:
					return "DefineShape2";
				case Tag.DefineButtonCxform:
					return "DefineButtonCxform";
				case Tag.Protect:
					return "Protect";
				case Tag.PlaceObject2:
					return "PlaceObject2";
				case Tag.RemoveObject2:
					return "RemoveObject2";
				case Tag.DefineShape3:
					return "DefineShape3";
				case Tag.DefineText2:
					return "DefineText2";
				case Tag.DefineButton2:
					return "DefineButton2";
				case Tag.DefineBitsJPEG3:
					return "DefineBitsJPEG3";
				case Tag.DefineBitsLossless2:
					return "DefineBitsLossless2";
				case Tag.DefineEditText:
					return "DefineEditText";
				case Tag.DefineSprite:
					return "DefineSprite";
				case Tag.FrameLabel:
					return "FrameLabel";
				case Tag.SoundStreamHead2:
					return "SoundStreamHead2";
				case Tag.DefineMorphShape:
					return "DefineMorphShape";
				case Tag.DefineFont2:
					return "DefineFont2";
				case Tag.ExportAssets:
					return "ExportAssets";
				case Tag.ImportAssets:
					return "ImportAssets";
				case Tag.EnableDebugger:
					return "EnableDebugger";
				case Tag.DoInitAction:
					return "DoInitAction";
				case Tag.DefineVideoStream:
					return "DefineVideoStream";
				case Tag.VideoFrame:
					return "VideoFrame";
				case Tag.DefineFontInfo2:
					return "DefineFontInfo2";
				case Tag.EnableDebugger2:
					return "EnableDebugger2";
				case Tag.ScriptLimits:
					return "ScriptLimits";
				case Tag.SetTabIndex:
					return "SetTabIndex";
				case Tag.FileAttributes:
					return "FileAttributes";
				case Tag.PlaceObject3:
					return "PlaceObject3";
				case Tag.ImportAssets2:
					return "ImportAssets2";
				case Tag.DefineFontAlignZones:
					return "DefineFontAlignZones";
				case Tag.CSMTextSetting:
					return "CSMTextSettings";
				case Tag.DefineFont3:
					return "DefineFont3";
				case Tag.SymbolClass:
					return "SymbolClass";
				case Tag.Metadata:
					return "Metadata";
				case Tag.DefineScalingGrid:
					return "DefineScalingGrid";
				case Tag.DoABC:
					return "DoABC";
				case Tag.DefineShape4:
					return "DefineShape4";
				case Tag.DefineMorphShape2:
					return "DefineMorphShape2";
				case Tag.DefineSceneAndFrameLabelData:
					return "DefineSceneAndFrameLabelData";
				case Tag.DefineBinaryData:
					return "DefineBinaryData";
				case Tag.DefineFontName:
					return "DefineFontName";
				case Tag.StartSound2:
					return "StartSound2";
				case Tag.DefineBitsJPEG4:
					return "DefineBitsJPEG4";
				case Tag.DefineFont4:
					return "DefineFont4";
				default:
					return "";
			}
		}
	}
}
